package com.neo.agent.connection;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Created by lock on 17-8-1.
 */

public class SpringBeanUtils implements ApplicationContextAware {

    private static ApplicationContext context;

    public static Object getBeans(String name){
        return context.getBean(name);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        SpringBeanUtils.context = applicationContext;
    }
}
